home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d22 / diskedit.arc / DEVIDEO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-06  |  2.6 KB  |  94 lines

  1. /* devideo.c - special video routines for diskedit.c */
  2. /* lrs - 2/13/89 */
  3.  
  4. #include "video.h"
  5.  
  6. void ErrorMessage(char mess[])
  7.   {
  8.   at(screenrows()-1,0);
  9.   cprintf(mess);
  10.   cleareol();
  11.   }    /* ErrorMessage */
  12.  
  13. void ClearErrorMessage()
  14.   {
  15.   at(screenrows()-1,0);
  16.   cleareol();
  17.   }    /* ClearErrorMessage */
  18.  
  19. void ShowWriteAllowed(int writeallowed)
  20.   {
  21.   at(14,0);
  22.   if (writeallowed)
  23.     cprintf("Write Ok  ");
  24.   else
  25.     cprintf("Write Prot");
  26.   }
  27.  
  28. void DisplayFrame()
  29.   {
  30.   int ct, linect;
  31.   
  32.   in(REVERSE); at(0,79-42);
  33.   cprintf(" Laine's Mighty Disk Editor  v0.0 02/13/89 ");
  34.   in(DIM);
  35.   at(2,0); cprintf("  CURRENT");
  36.   at(3,0); cprintf("Drive:");
  37.   at(4,0); cprintf("  Cyl:");
  38.   at(5,0); cprintf(" Head:");
  39.   at(6,0); cprintf("  Sec:");
  40.   at(8,0); cprintf("  MAXIMUM");
  41.   at(9,0); cprintf("  Cyl:");
  42.   at(10,0); cprintf(" Head:");
  43.   at(11,0); cprintf("  Sec:");
  44.   ShowWriteAllowed(0);
  45.   at(1,11);
  46.   cprintf("╔╦╦╦═══════════════════════════════════════════════╦════════════════╗");
  47.   at(2,11);
  48.   cprintf("╠╬╬╣ 0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F║0123456789ABCDEF║");
  49.   at(3,11);
  50.   cprintf("╠╩╩╬═══════════════════════════════════════════════╬════════════════╣");
  51.   linect = (screenrows() >= 43) ? 32 : 16;
  52.   for (ct = 0; ct < linect; ct++)
  53.     {
  54.     at(ct+4,11);
  55.     cprintf("║  ║                       -                       ║                ║");
  56.     }
  57.   at(ct+4,11);
  58.   cprintf("╚══╩═══════════════════════════════════════════════╩════════════════╝");
  59.   at(ct+5,4); in(NORMAL);
  60.   cprintf("PgUp/PgDn - Prev/Next Sector,  F10 Updates Sector (alt+F10 enables update)");
  61.   at(ct+6,2);
  62.   cprintf("G - Goto Sec, M - Modify byte, R/W - Read/Write Sec to/from File, ESC to quit");
  63.   } /* DisplayFrame */
  64. /*-----------------------------------------------------------------------*/
  65. void ShowMaxes(int maxcyl, int maxhead, int maxsec)
  66.   {
  67.   in(DIM);
  68.   at(9,7); cprintf("%3d",maxcyl);
  69.   at(10,7); cprintf("%3d",maxhead);
  70.   at(11,7); cprintf("%3d",maxsec);
  71.   }
  72. /*-----------------------------------------------------------------------*/
  73. void DisplaySector (int drive, int cyl, int head, int sec,
  74.             long *buf, int offs)
  75.   {
  76.   int ct, linect;
  77.   at(3,8); cprintf("%02x",drive);
  78.   at(4,7); cprintf("%3d",cyl);
  79.   at(5,7); cprintf("%3d",head);
  80.   at(6,7); cprintf("%3d",sec);
  81.   linect = (screenrows() >= 43) ? 32 : 16;
  82.   buf += offs*16;
  83.   for(ct = 0;  ct < linect; ct++)
  84.     {
  85.     at(ct+4,12); in(DIM); cprintf("%02X",ct+offs);
  86.     at(ct+4,15); in(NORMAL);
  87.     Write16Bytes(buf);
  88.     buf+=16;
  89.     }    /* for(ct = 0  to linect */
  90.   at(screenrows()-2,0);
  91.   } /* DisplaySector */
  92.  
  93. /*---- end of devideo.c ----*/
  94.